﻿<link rel="stylesheet" type="text/css" href="__ADMIN__/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/h-ui.admin/css/style.css" />
<article class="cl pd-20">
	<form action="{:url('admin/Rule/rule_group')}" method="post" class="form form-horizontal" id="form-admin-role-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>角色名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label>{$group_data['title']}</label>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">备注：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$group_data['bak']}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">网站权限：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{volist name="rule_data" id="v"}
				{empty name="v['child']"}
				<dl class="permission-list">
					<dt>
						<label>
							<input type="checkbox" value="{$v['id']}" {if condition="in_array($v['id'],$group_data['rules'])"}	checked="checked" {/if} name="rule_ids[]" onclick="checkAll(this)" id="user-Character-0">
							{$v.title}</label>
					</dt>
				</dl>
				{else /}
				<dl class="permission-list">
					<dt>
						<label>
							<input type="checkbox" value="{$v['id']}" {if condition="in_array($v['id'],$group_data['rules'])"}	checked="checked" {/if} name="rule_ids[]" onclick="checkAll(this)" id="user-Character-0">
							{$v.title}</label>
					</dt>
					<dd>
						{volist name="v['child']" id="n"}
						<dl class="cl permission-list">
							<dt>
								<label class="">
									<input type="checkbox" value="{$n['id']}" name="rule_ids[]" id="user-Character-0-0" {if condition="in_array($n['id'],$group_data['rules'])"} checked="checked"{/if} onclick="checkAll(this)">
									{$n['title']}</label>
							</dt>
							<dd>
								{notempty name="n['child']"}

									{volist name="n['child']" id="c"}
										<label class=""><input type="checkbox" value="{$c['id']}" name="rule_ids[]" id="user-Character-0-0-0" {if condition="in_array($c['id'],$group_data['rules'])"} checked="checked"{/if}>{$c['title']}</label>
									{/volist}

								{/notempty}
							</dd>
						</dl>
						{/volist}
					</dd>
				</dl>
				{/empty}
				{/volist}
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input type="hidden" name="id" value="{$group_data['id']}">
				<button type="submit" class="btn btn-success radius" id="admin-role-save" name="admin-role-save"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</article>
<script type="text/javascript" src="__ADMIN__/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__ADMIN__/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="__ADMIN__/h-ui.admin/js/H-ui.admin.page.js"></script> 
<script type="text/javascript">
	function checkAll(obj){
	    $(obj).parents('.permission-list').eq(0).find("input[type='checkbox']").prop('checked', $(obj).prop('checked'));
	}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>